var row = 0;
var col = 0;

function focusOnFirst() {
// focus on first array element
nextPage = document.getElementById("row0col0");
nextPage.focus();
}s

function getToType(e)
{
var keynum;
var nextPage;
if(window.event) // IE
  {
  keynum = e.keyCode;
  }
else if(e.which) // Netscape/Firefox/Opera
  {
  keynum = e.which;
  }

if ((keynum == 37)&&(col > 0)) {
	col--;
} else if ((keynum == 39)&&(col < 5)) {
	col++;
} else if ((keynum == 38)&&(row > 0)) {
	row--;
} else if ((keynum == 40)&&(row < 5)) {
	row++;
}
nextPage = document.getElementById("row" + row + "col" + col);
nextPage.focus();
}